<template>
    <view class="detail">
      <view class="heught"></view>
      <feed-item :type="1" :item="item"></feed-item>
      <view class="bt" @click="submit">确认处理</view>
      <modal-item v-if="showModal" ref="child" :item="content" :titleShow="false" @submit="chuli"  ></modal-item>
    </view>
</template>

<script>
import FeedItem from "../../components/feedBack/feedItem";
import ModalItem from "../../components/item/modalItem";
export default {
  name: "feedDetail",
  components: {ModalItem, FeedItem},
  data(){
    return{
      content:'确认处理？',
      showModal:false,
      item:{},
    }
  },
  computed:{

  },
  onLoad(option){
    this.item = JSON.parse(option.item)
  },
  methods:{
    // 处理反馈
    chuli(){
      this.showModal = false
      this.$api.deal({id:this.item.id}).then(res => {
        this.$u.route({
          url: '/pages/feedBack/feedBack',
        });
        this.$u.toast('操作成功')
      })
    },
    // 打开弹框
    submit(){
      this.showModal = true
    },
  },
}
</script>

<style scoped lang="scss">
  .detail{
    .heught{
      height: 20rpx;
      background: $uni-bg-color-grey;
      width: 100%;
    }
    .bt{
      margin-top: 90rpx;
    }
  }
</style>